#include "updatearticlelistfirstrequest.h"
#include "updatearticlelistfirstresponse.h"

//#include <json.h>

#include <QTextStream>
#include <QVariant>
#include <QDebug>
#include <QUrl>

UpdateArticleListFirstRequest::UpdateArticleListFirstRequest(int _userId,
                                                             int _sid,
                                                             int _cid,
                                                             int _count,
                                                             int _articleInfoCount,
                                                             int _firstId,
                                                             QObject *parent)
    :Network::GetJSONRequest(parent),
    m_response(new UpdateArticleListFirstResponse),
    m_userId(_userId),
    m_sid(_sid),
    m_cid(_cid),
    m_count(_count),
    m_articleInfoCount(_articleInfoCount),
    m_firstId(_firstId)

{
}

Network::JSONResponse &UpdateArticleListFirstRequest::jsonResponse()
{
    return *m_response;
}

const Network::JSONResponse &UpdateArticleListFirstRequest::jsonResponse() const
{
    return *m_response;
}

QUrl UpdateArticleListFirstRequest::url() const
{
    QString url = QString("http://newsreader2.me.zing.vn/mrm/ver2/article?method=get_update_article_list_by_category&uid=%1&sid=%2&cid=%3&count=%4&includearticleinfo=true&articleinfocount=%5&firstlid=%6")
            .arg(m_userId)
            .arg(m_sid)
            .arg(m_cid)
            .arg(m_count)
            .arg(m_articleInfoCount)
            .arg(m_firstId);

    return QUrl(url);
}
